<!doctype html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>神灯速贸</title>
        <meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no,minimal-ui" />
        <meta name="apple-mobile-web-app-capable" content="yes" />
        <meta content="telephone=no" name="format-detection" />
        <meta name="msapplication-tap-highlight" content="no"/>
        <link rel="stylesheet" href="../css/public.css">
        <link rel="stylesheet" href="../css/main.css">
        <script src="../js/zepto.min.js"></script>
        <script src="../js/main.js"></script>
    </head>
    <body>
	    <header class="header" style="display: block;">
	        <div class="title">意见反馈</div>
	        <a class="btn-back" href="#"><span>我</span></a>
            <a class="submit-feedback head-btn-right" href="#">提交</a>
	    </header>
			
	    <div class="container campaign-join-page">
	  		<form class="feedback-form" action="#" method="post">
                <div class="label2">请留下你的宝贵意见，我们会尽快回复的！</div>
                <textarea id="feedback" name="feedback" id="feedback" rows="5" cols="50" minlength="15" maxlength="500"></textarea>      
                <div class="text-notice"><span id="notice-num">0</span>/500</div>
            </form>
	    </div> 
        <script>
            $(function(){
                $(".submit-feedback").tap(function(e){
                    e.preventDefault();
                    var feedback = $('#feedback').val();
                    if (feedback.length === 0) {
                        alert('不能为空');
                        return false;
                    } else if(feedback.length <= 15) {
                        alert('不能少于15字');
                        return false;
                    }
                    $(".feedback-form").submit();
                })

                document.getElementById("feedback").onpropertychange =document.getElementById("feedback").onkeyup= function(){   
                    var textNum = this.value.length;  
                    var noticeNum = $("#notice-num").text();
                    $("#notice-num").text(500  - textNum);
                }
                
            })
        </script>
    </body>
</html>